<?php
/*
Plugin Name: Access History
Plugin URI: 
Version: v1.0
Author: <a href="http://huynhuan.wordpress.com">HuanHH</a>
Description: Power by Cao Dang Nghe Long An.
*/
?>
<?php 
class AccessHistory extends WP_Widget {

	function AccessHistory() {
		$widget_ops = array('classname' => 'access_history', 'description' => 'Access History' );
		$control_ops = array ('width' => '200', 'height' => '400');
		$this->WP_Widget('access_history', 'Access History', $widget_ops, $control_ops);
	}
	
	function widget($args, $instance) {
		extract($args);
		extract($instance);
		?>
		<div id="box_nocolor">
			<div class="top">
				<div class="title"><?php print $title; ?></div>
			</div>
			<div class="center">
				<ul>
					<li><a href="">Trang chủ</a></li>
					<li><a href="">Giới thiệu</a></li>
					<li><a href="">Lịch sử hình thành</a></li>
					<li><a href="">Phòng khoa trung tâm</a></li>
					<li><a href="">Tin tức & sự kiện</a></li>
				</ul>
			</div>
			<div class="bot"></div>
		</div>
		<?php
	}

	function update($new_instance, $old_instance) {
		$instance = $old_instance;

		$title = $new_instance['title'];
		
		$instance = compact('title');
		return $instance;
	}

	function form($instance) {
		$defaults=array(
			'title' => __('Thông tin truy cập', 'cdnla')
		);
		
		$options = wp_parse_args($instance, $defaults);
		extract($options);

		?>

		<div>
			<div>Title:</div>
			<div><input  id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></div>
		</div>

		<?php
	}
}

if (class_exists("AccessHistory")) {
	$access_history = new AccessHistory();
}

function register_access_history() {
	register_widget('AccessHistory');
}
add_action('widgets_init', 'register_access_history');

?>
